<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="/js/jquery.js"></script>
    <title>admin</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script src="/js/component/user.js"></script>
</head>
<body>
    <div id="app">
        <aside>
            <ul>
                <li>
                    <a href="/admin/user">用户管理</a>
                </li>
                <li>
                    <a href="/">返回首页</a>
                </li>
            </ul>
        </aside>
        {{ message }}</div>
    <div onclick="logout()">退出</div>
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                message: 'Hello Vue!'
            },
            methods: {
                
            }
           
        })
        console.log('app----', app);
        function logout() {
            $.ajax({
                url: "/api/logout",
                method: 'POST',
                data: {},
                success: function( result ) {
                    window.location.href = "/login";
                }
            });
        }
    </script>
</body>
</html>